﻿@page "/Iteration/Details/{id}"
@using FC.ViewModel.IterationVMs;
@inherits BasePage

<ValidateForm @ref="vform" Model="@Model" >
    <Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">

            <Display @bind-Value="@Model.Entity.ChargeUserId" Lookup="@AllFrameworkUsers"  ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.Name"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.StartTime"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.EndTime"   ShowLabel="true"/>
    </Row>
    <div class="modal-footer table-modal-footer">
        <Button Color="Color.Primary" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />
    </div>
</ValidateForm>

@code {

    private IterationVM Model = null;
    private ValidateForm vform { get; set; }
    [Parameter]
    public string id { get; set; }

    private List<SelectedItem> AllFrameworkUsers = new List<SelectedItem>();


    protected override async Task OnInitializedAsync()
    {

        AllFrameworkUsers = await WtmBlazor.Api.CallItemsApi("/api/Iteration/GetFrameworkUsers", placeholder: WtmBlazor.Localizer["Sys.All"]);

        var rv = await WtmBlazor.Api.CallAPI<IterationVM>($"/api/Iteration/{id}");
        Model = rv.Data;
    }

    public void OnClose()
    {
        CloseDialog();
    }

}
